/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cardgame;

import java.awt.Graphics;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;

/**
 *
 * @author Carl
 */
public class PanCard_Deck extends javax.swing.JPanel{

    public PanCard_Deck(){
        initComponents();
        setOpaque(false);
    }
    public static BufferedImage resourceImage_Back = Util.getResourceImage("/cardgame/resources/images/back.jpg");
    private int size;

    public void setSize(int size){
        this.size = size;
        updateUI();
    }

    @Override
    protected void paintComponent(Graphics _graphics){
        super.paintComponent(_graphics);
        Graphics2D graphics = (Graphics2D) _graphics;
        graphics.translate(5, 7.5);
        graphics.scale(0.75, 0.75);
        graphics.drawImage(resourceImage_Back, 0, 0, getWidth(), getHeight(), this);
        graphics.setColor(Color.WHITE);
        graphics.setFont(new Font("Verdana", Font.PLAIN, 18));
        graphics.drawString("" + size, 9, 34);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 40, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 60, Short.MAX_VALUE)
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
